package cn.supermaster.management.web.controller.system;

import cn.supermaster.management.web.service.system.ISPostService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import cn.supermaster.management.common.controller.BaseController;

/**
 * All rights Reserved, Designed By www.super-bytecode.com
 *
 * @ProjectName: supermaster-management
 * @Package: cn.supermaster.management.web.rest.system
 * @ClassName: SystemPostRestController
 * @Description: [岗位信息操作处理]
 * <p> </p>
 * @Author: [Lance Ting]
 * @Date: 2021/1/12 0:04
 * @Version: V1.0
 * @Copyright: 2021 www.super-bytecode.comn Inc. All rights reserved.
 * TODO: 注意,本文件Lance Ting所作,如果转载或使用请标明具体出处!
 **/
@Controller
@RequestMapping("/system/post")
public class SystemPostController extends BaseController {

    @Autowired
    private ISPostService postService;

    @RequiresPermissions("system:post:view")
    @GetMapping()
    public String skipPostIndexHtml() {
        return postService.skipPostIndexHtml();
    }

    /**
     * 新增岗位
     */
    @GetMapping("/add")
    public String skipAddPostHtml() {
        return postService.skipAddPostHtml();
    }

    /**
     * 修改岗位
     */
    @GetMapping("/edit/{postId}")
    public String edit(@PathVariable("postId") Long postId, ModelMap modelMap) {
        return postService.skipModifyPostHtml(modelMap, postId);
    }
}
